<div class=view-category>
	<a href="<?php echo Epic::getUrl('blog/category/new') ?>" class=button><img src="<?php echo Epic::getImgUrl(); ?>icon/cms.gif" alt="Create New Category"/>Create New Category</a>
	<br /><br /><br />
	
	<?php if($this->getCategories()): ?>
		<table class="table">
		<thead>
			<tr>
				<th>ID</th>	
				<th>Name</th>	
				<th>Enabled</th>
				<th>Actions</th>	
			</tr>
		</thead>
		<tbody>
		<?php $irow = 0;foreach($this->getCategories() as $category):?>
			<tr <?php echo ($irow++%2 ? 'class="alt_row"' : '') ?>>
				<td class="center"><?php echo $category['category_id']; ?></td>
				<td class="pointer"><a><?php echo $category['name']; ?></a></td>
				<td class="pointer center">
					<a href="#">
					<?php if($category['active']):?>
						<img title="Enabled" alt="Enabled" src="<?php echo Epic::getImgUrl(); ?>icon/enabled.gif">
					<?php else: ?>
						<img title="Disable" alt="Disable" src="<?php echo Epic::getImgUrl(); ?>icon/disabled.gif">
					<?php endif; ?>
					</a>
				</td>
				<td style="white-space: nowrap;" class="center">
					<a href="<?php echo Epic::getUrl('blog/category/edit').'?id='.$category['category_id']; ?>"><img title="Edit" alt="" src="<?php echo Epic::getImgUrl(); ?>icon/edit.gif"></a>
					<a onclick="return confirm('Delete item #<?php echo $category['category_id']?> ?');" href="<?php echo Epic::getUrl('blog/category/delete', array('id'=>$category['category_id']))?>"><img title="Delete" alt="Delete" src="<?php echo Epic::getImgUrl(); ?>icon/delete.gif"></a>
				</td>
			</tr>
		<?php endforeach;?>
		</tbody>
		</table>
	<?php else:?>
		<span style="color: blue;">You do not have any category yet!</span>
	<?php endif;?>
</div>